package edu.rpi.tw.escience.stargazer.data;

import java.util.Date;

import org.joda.time.DateTime;
import org.joda.time.Days;

public class Time implements Comparable{
	DateTime dt = null;
	static DateTime J2000 = new DateTime(2000, 1, 1, 23, 59, 27, 816);
	
	public Time(String year, String month, String day, String hour, String minute, String second){
		this.dt = new DateTime(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day), Integer.parseInt(hour), Integer.parseInt(minute), Integer.parseInt(second), 0);
	}
	
	public DateTime getDate(){
		return dt;
	}
	
	public int compareTo(Object t2){
		return this.compareTo(((Time)t2).getDate());
	}
	
	public int numberOfSeconds(){
		return Days.daysBetween(this.dt, J2000).toStandardSeconds().getSeconds();
	}

	
}
